package com.avic.map.dal.mapper;

import com.avic.map.dal.condition.EmergencyListCondition;
import com.avic.map.dal.model.Emergency;
import com.avic.map.dal.model.EmergencyCar;
import com.avic.map.dal.model.EmergencySoldier;
import com.avic.map.dal.model.EmergencyTagging;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface EmergencyMapper {

    /**
     * 新增应急数据
     *
     * @param emergency
     * @return
     */
    int insertEmergency(Emergency emergency);

    /**
     * 更新应急数据
     *
     * @param emergency
     * @return
     */
    int endEmergencyUpdate(Emergency emergency);

    /**
     * 获取应急记录列表数据
     *
     * @param emergencyListCondition
     * @return
     */
    List<Emergency> queryEmergencyList(EmergencyListCondition emergencyListCondition);

    /**
     * 获取应急记录列表数据总数
     *
     * @param emergencyListCondition
     * @return
     */
    int queryEmergencyListTotal(EmergencyListCondition emergencyListCondition);

    /**
     * 查询当前应急的数量
     */
    Emergency queryCurrentEmergency(int emergencyState);


    int insertEmergencyCar(@Param("carList") List<String> carList, @Param("emergencyId") String emergencyId);

    int insertEmergencySoldier(@Param("soldierList") List<String> soldierList, @Param("emergencyId") String emergencyId);

    int insertEmergencyTagging(@Param("emergencyId") String emergencyId);

    int updateEmergency(Emergency emergency);


    // 查询应急详情

    List<EmergencyCar> emergencyCarList(@Param("emergencyId") String emergencyId);

    Emergency queryEmergencyDetail(@Param("emergencyId") String emergencyId);

    List<EmergencySoldier> emergencySoldierList(@Param("emergencyId") String emergencyId);

    List<EmergencyTagging> emergencyTaggingList(@Param("emergencyId") String emergencyId);
}
